<?php
/**
 * Created by PhpStorm.
 * User: 69548
 * Date: 2018/8/17
 * Time: 17:25
 */

namespace app\wap\model;


use think\Model;

class Classify extends Model
{

    public function index(){

        $classify= $this->where('classify_status',1)->field('classify_id,classify_name')->select();

//        $tag=model('Tag')->where(['tag_status'=>1])->where(['tag_type'=>2])->field('tag_id,tag_name')->select();

        $tag= [];

        if ($classify==true){
            if ($tag==false ){
                $tag  =[];
            }
            $shu=[
                'code'=>0,
                'msg'=>'请求成功',
                'data'=>[
                    'classify'=>$classify,
                    'tag'=>$tag
                ]

            ];

        }else{
            $shu=[
                'code'=>101,
                'msg'=>'查询错误',
            ];
        }

        return $shu;
    }



}